package com.ruoyi.hospital.entity.check;

import com.ruoyi.common.annotation.Excel;
import com.ruoyi.hospital.entity.ItemsListReturnVO;
import com.ruoyi.service.domain.ServiceCombo;

import java.util.ArrayList;
import java.util.List;

/**
 * 服务项目及套餐列表返回体
 *
 * @author ZDL
 */

@lombok.Data
public class CheckItemsListReturnVO {

    /** 服务项目ID */
    private Long itemId;

    /** 名称 */
    @Excel(name = "名称")
    private String itemName;

    /** 介绍 */
    //服务项目下套餐
    private List<CheckServiceCombo> combos;


    public void init(ItemsListReturnVO itemsCombosNode) {
        this.setItemId(itemsCombosNode.getItemId());
        this.setItemName(itemsCombosNode.getItemName());
        if (this.getCombos() == null){
            this.setCombos(new ArrayList<CheckServiceCombo>());
        }
        for (ServiceCombo itemCombo : itemsCombosNode.getCombos()){
            CheckServiceCombo combo = new CheckServiceCombo();
            combo.init(itemCombo);
            this.getCombos().add(combo);
        }

    }
}
